@extends('admin::layouts.master')
@section('title') 门店列表 @endsection
@section('tab')
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body" style="border-bottom: none;">
                        <form class="layui-form layui-col-space5">
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="text" name="name" placeholder="门店名称" value="{{$data['arr_search']['name']}}"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="text" name="phone" placeholder="联系电话" value="{{$data['arr_search']['phone']}}"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <select name="cate">
                                    <option value="">类型</option>
                                    <option value="1" @if($data['arr_search']['cate']==1) selected @endif>检测站</option>
                                    <option value="2" @if($data['arr_search']['cate']==2) selected @endif>维修店</option>
                                </select>
                            </div>

                            <div class="layui-input-inline layui-show-xs-block">
                                <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                    <i class="layui-icon">&#xe615;</i>
                                </button>
                                <button class="layui-btn" onclick="location.reload()">
                                    <i class="layui-icon layui-icon-refresh"></i>
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="layui-card-body layui_overflow_y ">
                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th>店铺名称</th>
                                <th>类型</th>
                                <th>联系方式</th>
                                <th>申请时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            @foreach($data['data'] as $key=>$value)
                                <tr>
                                    <td>{{$value['name']}}</td>
                                    <td>
                                        @if($value['cate'] == 2) 维修店 @else 检测站 @endif
                                    </td>
                                    <td>{{$value['phone']}}</td>
                                    <td>{{$value['created_at']}}</td>
                                    <td class="td-manage">
                                        <button class="layui-btn layui-btn-xs" onclick="xadmin.open('店铺详情','{{route("admin_shop_info",['id'=>$value['id']])}}')" href="javascript:;" >查看详情</button>
                                    </td>
                                </tr>
                            @endforeach
                            @if(empty($data['data']))
                                <td colspan="20" align="center">暂无数据</td>
                            @endif
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            {{$data['page_link']}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection


@section('tab_js')
    <script>
        layui.use('form', function(){
            var form = layui.form;
            form.render();
        });
    </script>
@endsection




